BP (Set Breakpoint) 

Syntax

[thread] BP [breakpoint] [location] [condition] [option...]

Parameters

thread

The thread that the breakpoint will apply to. See Process and Thread Syntax2LMXWU for more information on the thread syntax.

breakpoint

The breakpoint number to be set. If the given breakpoint number already exists, the new breakpoint will replace the old.

location

The memory location of the breakpoint, in the format given in the table below.

condition

One of the breakpoint conditions given in the table below. You can specify multiple conditions for a breakpoint.

option

One of the breakpoint options given in the table below. Separate multiple options with spaces.

 

Description

Sets a breakpoint. You can combine locations, conditions, and options to set different kinds of breakpoints. If you do not specify a thread, the breakpoint will apply to all threads.

If you want to put a breakpoint on a C++ public, enclose the expression in parentheses. For example,  BP (??MyPublic)  or  BP (operator new) .

On x86 computers, WinDbg will use debug registers to implement watchpoints if:

    There is a debug register available

    Memory size is 1

    Memory size is 2 and address is WORD aligned

    Memory size is 4 and address is DWORD aligned

 

You can use the following options when setting a breakpoint:

Location

Description

 

[[procedure], [module], [exe]}]address

The address for the breakpoint.

 

[[procedure], [module],
[exe]}]@line

The line number for the breakpoint.

 

 

Condition

Description

 

?expression

Break if expression is true.

 

=address [/Rcount]

Break if memory at address has changed. Use the /R option to specify the number of bytes to check (default is 1).

 

 

Option

Description

 

/Pcount

Ignore the breakpoint count times.

 

/Ccmdlist

Execute cmdlist when the breakpoint is hit. The cmdlist parameter is a semicolon-separated list of one or more debugger commands. If cmdlist includes multiple commands, enclose it in quotes (").

 

/Mmessagename
/Mmessageclass

Break only if the given message name or message class has been received.

 

/Q

Suppress the unresolved-breakpoint dialog box for this breakpoint.

 

/Hprocess

Specify the process number to attach the breakpoint to. Defaults to all threads in process if /T is not used.

If /H is not specified and no debuggee is running, the default is process 0.

 

/Tthread

Specify the thread number to attach the breakpoint to. Defaults to current process if /H is not used.